﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using xTeam.Glgcx.CommonUtilities;

namespace xTeam.Glgcx.Controllers.HomePage
{
    public class HomeController : BaseController
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult GetClassiyfByMoulelKey(string moduleKey = "", string template = "")
        {


            ViewData.Model = _classifyBal.GetClassiyfListByModuleKey(moduleKey);
            return string.IsNullOrEmpty(template)
                ? (ActionResult)new EmptyResult()
                : View(template);
        }

        public ActionResult GetClassiyfByTagName(string tagName = "", string template = "")
        {
            EClassify classify = _classifyBal.GetClassifytByETag(tagName, "Archive");

            return !string.IsNullOrEmpty(template) && classify != null
                ? View(template
                , (classify.ChildList.Count < 1 && classify.Parent != null) ? classify.Parent : classify)
                : (ActionResult)new EmptyResult();
        }
    }
}
